package com.prs.crm.dao.pm.impl;

import java.sql.SQLException;
import java.util.Collection;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.pm.PmTypeDao;
import com.prs.crm.domain.pm.PmType;

public class PmTypeDaoImpl extends BaseDaoImpl<PmType> implements PmTypeDao{

	@Override
	@SuppressWarnings("unchecked")
	public Collection<PmType> getAllPmType() {
		// TODO Auto-generated method stub
		return (Collection<PmType>)this.getHibernateTemplate().executeFind(new HibernateCallback() {

			@Override
			public Object doInHibernate(Session arg0)
					throws HibernateException, SQLException {
				// TODO Auto-generated method stub
				Criteria criteria = arg0.createCriteria(PmType.class);				
				return criteria.list();
			}
			
		});
	}

}
